<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script>
var contextPath='${contextPath}';

$(function(){
	$( "#target" ).change( target_changed );
});

function target_changed( e )
{
	var user = $( "#target" ).val();
	if( empty( user ) )
		return;

	// 清空所有已选定的中心地址
	$("#sxian").val("");

	// 加载已选定的咨询师的所选中心地址
	submitter.post( contextPath+"/index/system_consult_distr_get.json", { username: user }, function( d )
	{
		var sxian = d.sxian;
		$("#sxian").val(sxian);
	}, "json" );
}

function submit_form()
{
	var data = {};

	// 选定咨询师
	data.target = $( "#target" ).val();

	if( empty( data.target ) )
	{
		alert( "请先选定咨询师目标。" );
		return;
	}

	// 选定中心地址
	data.sxian = $("#sxian").val();

	submitter.post( "system_consult_distr_go.json", data, function( d )
	{
		alert("设置成功");
	}, "json" );
}

</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>咨询师</li>
			<li>&gt;</li>
			<li class="current"></li>
		</ul>
	</div>
	<div id="caption">
		<ul>
			<li><span class="title">操作提示：</span></li>
			<li>Ctrl+Enter 提交</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table id="tbl_client">
			<tr class="fields">
				<th colspan="2">咨询师选择</th>
			</tr>
			<tr>
				<th width="25%">目标咨询师</th>
				<td width="75%">
					<select id="target">
						<option value="">-- 请选择目标 --</option>
						<#if infoList??>
							<#list infoList as list>
								<option value="${list.username}">${list.nickname}（${list.regions}-${list.departments}-${list.job}）</option>
							</#list>
						</#if>
					</select>
				</td>
			</tr>
			<tr rel="hide">
				<th>每日资源上限设置</th>
				<td id="source">
					<select id="sxian">
						<option value="">请选择上线个数</option>
						<option value="5">5个内</option>
						<option value="6">6个内</option>
						<option value="7">7个内</option>
						<option value="8">8个内</option>
						<option value="9">9个内</option>
						<option value="10">10个内</option>
						<option value="11">11个内</option>
						<option value="12">12个内</option>
						<option value="13">13个内</option>
						<option value="14">14个内</option>
						<option value="15">15个内</option>
						<option value="16">16个内</option>
						<option value="17">17个内</option>
						<option value="18">18个内</option>
						<option value="19">19个内</option>
						<option value="20">20个内</option>
						<option value="21">21个内</option>
						<option value="22">22个内</option>
						<option value="23">23个内</option>
						<option value="24">24个内</option>
						<option value="25">25个内</option>
						<option value="26">26个内</option>
						<option value="27">27个内</option>
						<option value="28">28个内</option>
						<option value="29">29个内</option>
						<option value="30">30个内</option>
					</select>
				</td>
			</tr>
		</table>
		<div class="remark">
			<ul>
				<li><span class="title">注意事项：</span></li>
				<li>1、分配中心临时权限时，可以同时选定多个</li>
				<li>2、若需要将指定咨询师的权限中心地址清空，只要选定该咨询师，然后取消所有勾选即可</li>
			</ul>
		</div>
		<div id="controlbar">
			<input id="btnSubmit" onclick="submit_form()" type="button" class="submit" value="  保存分配设置  " />
		</div>
	</div>
</body>
</html>